package com.kwin.excel.util;

import javax.validation.*;
import java.util.Set;

/**
 * @author : wangkai
 * @version V1.0
 * @Package com.kwin.excel.util
 * @Description:
 * @date 2021年10月19日 10:28
 **/
public class Validators {
    private static final Validator validator;
    
    static {
        ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
        validator = factory.getValidator();
    }
    
    public static <T> Set<ConstraintViolation<T>> validate(T object) {
        return validator.validate(object);
    }
}
